import java.util.Arrays;

public class test6 {
    static void main() {
        int[] arr ={1,2,3,4,5,6,7,8,9,10};
        int[]copyArr = copyOfRange(arr,3,7);
        for(int j=0;j<copyArr.length;j++){
            System.out.println(copyArr[j]+" ");
        }
    }

    static int[] copyOfRange(int[] arr, int from, int to) {
        int[] newArr = new int[to - from ];
        int Index = 0;
        for (int i = from; i < to; i++) {
        newArr[Index] = arr[i];
        Index++;
        }
        return newArr;
    }

}
